package com.italicatab;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ListView;

public class MainActivity extends Activity {

	private ListView gd_view;
	private TilesAdapter tAdapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		gd_view=(ListView)findViewById(R.id.lv);
		//tAdapter=new TilesAdapter(this);
	//	gd_view.setAdapter(tAdapter);
		
		Intent i=new Intent(getApplicationContext(), HomeScreen.class);
		startActivity(i);
		finish();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	
	
	public class TilesAdapter extends BaseAdapter {
		// it is a custom adapter by this we are showing driver login
		// information as a list
		private Activity activity;
		private String[] data;
		private LayoutInflater inflater = null;
	
		public TilesAdapter(Activity a) {
			activity = a;
			inflater = (LayoutInflater) activity
					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		}

		public int getCount() {
			return 10;
		}

		public Object getItem(int position) {
			return position;
		}

		public long getItemId(int position) {
			return position;
		}

		public View getView(final int position, View convertView, ViewGroup parent) {
			//View vi = convertView;
			if (convertView == null)
			{
				convertView = inflater.inflate(R.layout.raw_product, parent,false);
			}
			

			
			
			return convertView;
		}

	}

}
